import http from '../utils/request'

/** 宏泰 */

// 部门员工信息
export function deptEmpInfoList(params) {
  return http.post('/deptEmpInfo/list', { ...params })
}

// 增加部门员工
export function deptEmpInfoAdd(staff) {
  return http.post('/deptEmpInfo/add', { ...staff })
}

// 修改部门员工
export function deptEmpInfoUpdate(staff) {
  return http.post('/deptEmpInfo/update', { ...staff })
}

// 删除部门员工
export function deptEmpInfoDelete(id) {
  return http.post('/deptEmpInfo/delete/'+id)
}

/**
 * 车辆信息
 */

// 车辆基本信息
export function vehicleBasicInfoList(params) {
  return http.post('/vehicleBasicInfo/list', { ...params })
}

/**
 * 车辆基本信息修改
 */
export function vehicleBasicInfoUpdate(params) {
  return http.post('/vehicleBasicInfo/update', { ...params })
}

/**
 * 车辆基本信息添加
 */
 export function vehicleBasicInfoAdd(params) {
  return http.post('/vehicleBasicInfo/add', { ...params })
}

/**
 * 车辆基本信息删除
 */
 export function vehicleBasicInfoDelete(id) {
  return http.post(`/vehicleBasicInfo/delete/${id}`)
}

/**
 * 车辆检测评定
 */
// 车辆基本信息
export function carcheckList(params) {
  return http.post('/vehicleCheckEvaluate/list', { ...params })
}

/**
 * 车辆基本信息修改
 */
export function carcheckUpdate(params) {
  return http.post('/vehicleCheckEvaluate/update', { ...params })
}

/**
 * 车辆基本信息添加
 */
 export function carcheckAdd(params) {
  return http.post('/vehicleCheckEvaluate/add', { ...params })
}

/**
 * 车辆基本信息删除
 */
 export function carcheckDelete(id) {
  return http.post(`/vehicleCheckEvaluate/delete/${id}`)
}

/**
 * 车辆基本信息excel下载
 */
export function vehicleBasicInfoDownExl() {http.download('/vehicleBasicInfo/downloadExcel', '车辆基本信息.xlsx')}

export function goodsOutDownExl() {http.download('/goodsOutStorehouse/downloadExcel', '物资出库表.xlsx')}

export function goodsInDownExl() {http.download('/goodsIntoStorehouse/downloadExcel', '物资入库表.xlsx')}

export function goodsCheckDownExl() {http.download('/goodsCheck/downloadExcel', '物资盘点表.xlsx')}

export function carCheckDownExl() {http.download('/vehicleCheckEvaluate/downloadExcel', '车辆检测和评定登记表.xlsx')}

export function driveCostDownExl() {http.download('/monthDriveMileageCost/downloadExcel', '月行驶里程和费用表.xlsx')}

/**
 * ==========================================
 * 图片上传 common/image
 * @param files {Array} 图片数组
 * @return  redPackageList {Array} 优惠红包列表 resource/image     uEditorImage  {'Content-Type': 'multipart/form-data'},
 * ==========================================
 **/
 export const uploadImgCar = (files,id,bz) => http.upload(`/vehicleBasicInfo/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadImgDept = (files,id,bz) => http.upload(`/deptEmpInfo/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadImgMaintenance = (files,id,bz) => http.upload(`/vehicleRepairRecord/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelCar = (files, mode) => http.upload(`/vehicleBasicInfo/importExcel/${mode}`, files)

 export const uploadImgGoodsOut = (files,id,bz) => http.upload(`/goodsOutStorehouse/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelGoodsOut = (files, mode) => http.upload(`/goodsOutStorehouse/importExcel/${mode}`, files)

 export const uploadImgGoodsIn = (files,id,bz) => http.upload(`/goodsIntoStorehouse/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelGoodsIn = (files, mode) => http.upload(`/goodsIntoStorehouse/importExcel/${mode}`, files)

 export const uploadImgGoodsCheck = (files,id,bz) => http.upload(`/goodsCheck/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelGoodsCheck = (files, mode) => http.upload(`/goodsCheck/importExcel/${mode}`, files)

 export const uploadImgCheckCar = (files,id,bz) => http.upload(`/vehicleCheckEvaluate/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelCheckCar = (files, mode) => http.upload(`/vehicleCheckEvaluate/importExcel/${mode}`, files)

 export const uploadImgDriveCost = (files,id,bz) => http.upload(`/monthDriveMileageCost/uploadImage?id=${id}&bz=${bz}`, files)

 export const uploadExcelDriveCost = (files, mode) => http.upload(`/monthDriveMileageCost/importExcel/${mode}`, files)


 /**
  * 图片删除
  * @param {*} id 
  * @returns 
  */
export const delImgStaff = (fileName) => http.post(`/deptEmpInfo/deleteImage/${fileName}`)

export const delImgCar = (fileName) => http.post(`/vehicleBasicInfo/deleteImage/${fileName}`)

export const delImgMaintenance = (fileName) => http.post(`/vehicleRepairRecord/deleteImage/${fileName}`)

export const delImgGoodsOut = (fileName) => http.post(`/goodsOutStorehouse/deleteImage/${fileName}`)

export const delImgGoodsIn = (fileName) => http.post(`/goodsIntoStorehouse/deleteImage/${fileName}`)

export const delImgGoodsCheck = (fileName) => http.post(`/goodsCheck/deleteImage/${fileName}`)

export const delImgCarCheck = (fileName) => http.post(`/vehicleCheckEvaluate/deleteImage/${fileName}`)

export const delImgDriveCost = (fileName) => http.post(`/monthDriveMileageCost/deleteImage/${fileName}`)

 /**
  * 员工获取图片列表
  */
export function deptEmpInfoImgList(id) {
  return http.post('/deptEmpInfo/imageList/'+id)
}

 /**
  * 车辆获取图片列表
  */
  export function vehicleBasicInfoImgList(id) {
    return http.post('/vehicleBasicInfo/imageList/'+id)
  }

/**
* 物资出库获取图片列表
*/
export function goodsOutImgList(id) {
  return http.post('/goodsOutStorehouse/imageList/'+id)
}

/**
* 月行驶里程和费用获取图片列表
*/
export function driveCostImgList(id) {
  return http.post('/monthDriveMileageCost/imageList/'+id)
}

/**
* 物资入库获取图片列表
*/
export function goodsInImgList(id) {
  return http.post('/goodsIntoStorehouse/imageList/'+id)
}

/**
* 物资入库获取图片列表
*/
export function goodsCheckImgList(id) {
  return http.post('/goodsCheck/imageList/'+id)
}

/**
* 车辆检测获取图片列表
*/
export function checkCarImgList(id) {
  return http.post('/vehicleCheckEvaluate/imageList/'+id)
}

// 登录
export function userlogin(account, password) {
  return http.post('/user/login', {account, password})
}

// 登出
export function userlogout() {
  return http.post('/user/logout')
}

/**
 * 用户列表
 */
export function userList(params) {
  return http.post('/user/list', { ...params })
}

/**
 * 根据账号查询权限
 */
export function userAuthList(account) {
  return http.post('/userAuthority/list', { account })
}

/**
 * 用户冻结
 */
export function userFreeze(id) {
  return http.post(`/user/freeze/${id}`)
}

/**
 * 用户解冻
 */
export function userUnfreeze(id) {
  return http.post(`/user/unfreeze/${id}`)
}

/**
 * 用户修改
 */
 export function userUpdate(params) {
  return http.post(`/user/update`, {...params})
}

/**
 * 用户删除
 */
 export function userDelete(id) {
  return http.post(`/user/delete/${id}`)
}

/**
 * 用户添加
 */
 export function userAdd(params) {
  return http.post(`/user/add`, {...params})
}

/**
 * 车辆维保列表
 */
export function repairList(params) {
  return http.post('/vehicleRepairRecord/list', { ...params })
}

/**
 * 维保添加
 */
export function repairAdd(params) {
  return http.post('/vehicleRepairRecord/add', { ...params })
}

/**
 * 维保修改
 */
export function repairUpdate(params) {
  return http.post('/vehicleRepairRecord/update', { ...params })
}

/**
 * 维保删除
 */
export function repairDelete(id) {
  return http.post('/vehicleRepairRecord/delete/'+id)
}

/**
 * 维修厂店查询
 */
 export function repairFactoryList() {
  return http.post('/systemConfig/selectRepairFactory')
}

/**
 * 维修类别查询
 */
export function repairClassList() {
  return http.post('/systemConfig/selectRepairClass')
}

/**
 * 维修大项查询
 */
export function repairDxList() {
  return http.post('/systemConfig/selectRepairMaintainProj')
}

/**
 * 维修小项查询
 */
export function repairXxList() {
  return http.post('/systemConfig/selectRepairMaintainProjSon')
}

/**
 * 车牌号列表查询
 */
export function cpList() {
  return http.post('/systemConfig/selectPlateNumber')
}

/**
 * 负责司机列表查询
 */
 export function sjList() {
  return http.post('/systemConfig/selectEmpName')
}

/**
 * 维修获取图片列表
 */
export function repairImgList(id) {
  return http.post('/vehicleRepairRecord/imageList/'+id)
}

/**
 * 用户权限修改
 */
export function userAuthUpdate(params) {
  return http.post('/userAuthority/update', params)
}


/**
 * 月行驶里程和费用列表
 */
export function driveCostList(params) {
  return http.post('/monthDriveMileageCost/list', params)
}

//系统配置管理相关api
//获取系统名称API
export function xtmcselect(){
  return http.get('systemConfig/selectSystemName')
}
//修改系统名称
export function xtmcupdate(params) {
  return http.post('systemConfig/updateSystemName', {...params})
}
//获取授权时间
export function rjsqkssjselect(){
  return http.get('systemConfig/selectSoftAuthorityTime')
}
//获取每页条数数据
export function pageselect(){
  return http.get('systemConfig/selectPerPageRownum')
}
export function pageupdate(params) {
  return http.post('systemConfig/updatePerPageRownum', {...params})
}
//获取上传图片路径数据
export function uploadselect(){
  return http.get('systemConfig/selectPictureUploadPath ')
}
export function pictureupdate(params) {
  return http.post('systemConfig/updatePictureUploadPath', {...params})
}
//获取上传图片路径数据
export function logoselect(){
  return http.get('systemConfig/selectLogoPath')
}
export function logoupdate(params) {
  return http.post('systemConfig/updateLogoPath', {...params})
}
//获取车辆品牌
export function carselect() {
  return http.post('systemConfig/selectVehicleBrandAndSon')
}
//增加新的品牌
export function insertcarbrand(params) {
  return http.post('systemConfig/insertVehicleBrandAndSon ', {...params})
}
//修改品牌
export function updatecarbrand(params) {
  return http.post('systemConfig/updateVehicleBrandAndSon ', {...params})
}
//删除父品牌
export function deletecarbrand(id) {
  return http.post('systemConfig/deleteVehicleBrand/'+id)
}
//删除子品牌
export function deletecarbrandson(id) {
  return http.post('systemConfig/deleteVehicleBrandSon/'+id)
}
//获取部门数据
export function selectDept(){
  return http.get('systemConfig/selectDept')
}
export function updateDept(params) {
  return http.post('systemConfig/updateDept ', {...params})
}
export function insertDept(params) {
  return http.post('systemConfig/insertDept ', {...params})
}
export function deleteDept(params) {
  return http.post('systemConfig/deleteDept ', {...params})
}
//小组数据
export function selectTeam(){
  return http.get('systemConfig/selectTeam')
}
export function updateTeam(params) {
  return http.post('systemConfig/updateTeam ', {...params})
}
export function insertTeam(params) {
  return http.post('systemConfig/insertTeam ', {...params})
}
export function deleteTeam(params) {
  return http.post('systemConfig/deleteTeam ', {...params})
}

//仓库数据
export function selectStorehouseName(){
  return http.get('systemConfig/selectStorehouseName')
}
export function updateStorehouseName(params) {
  return http.post('systemConfig/updateStorehouseName ', {...params})
}
export function insertStorehouseName(params) {
  return http.post('systemConfig/insertStorehouseName ', {...params})
}
export function deleteStorehouseName(params) {
  return http.post('systemConfig/deleteStorehouseName ', {...params})
}
//维修类别
export function selectRepairClass(){
  return http.get('systemConfig/selectRepairClass')
}
export function updateRepairClass(params) {
  return http.post('systemConfig/updateRepairClass ', {...params})
}
export function insertRepairClass(params) {
  return http.post('systemConfig/insertRepairClass ', {...params})
}
export function deleteRepairClass(params) {
  return http.post('systemConfig/deleteRepairClass ', {...params})
}
//车辆类别
export function selectVehicleClass(){
  return http.get('systemConfig/selectVehicleClass')
}
export function updateVehicleClass(params) {
  return http.post('systemConfig/updateVehicleClass ', {...params})
}
export function insertVehicleClass(params) {
  return http.post('systemConfig/insertVehicleClass ', {...params})
}
export function deleteVehicleClass(params) {
  return http.post('systemConfig/deleteVehicleClass ', {...params})
}

//物资类别
export function selectGoodsClass(){
  return http.get('systemConfig/selectGoodsClass')
}
export function updateGoodsClass(params) {
  return http.post('systemConfig/updateGoodsClass ', {...params})
}
export function insertGoodsClass(params) {
  return http.post('systemConfig/insertGoodsClass ', {...params})
}
export function deleteGoodsClass(params) {
  return http.post('systemConfig/deleteGoodsClass ', {...params})
}
//测评类别
export function selectCheckEvaluateClass(){
  return http.get('systemConfig/selectCheckEvaluateClass')
}
export function updateCheckEvaluateClass(params) {
  return http.post('systemConfig/updateCheckEvaluateClass ', {...params})
}
export function insertCheckEvaluateClass(params) {
  return http.post('systemConfig/insertCheckEvaluateClass ', {...params})
}
export function deleteCheckEvaluateClass(params) {
  return http.post('systemConfig/deleteCheckEvaluateClass ', {...params})
}

//测评单位
export function selectCheckEvaluateOrg(){
  return http.get('systemConfig/selectCheckEvaluateOrg')
}
export function updateCheckEvaluateOrg(params) {
  return http.post('systemConfig/updateCheckEvaluateOrg ', {...params})
}
export function insertCheckEvaluateOrg(params) {
  return http.post('systemConfig/insertCheckEvaluateOrg ', {...params})
}
export function deleteCheckEvaluateOrg(params) {
  return http.post('systemConfig/deleteCheckEvaluateOrg ', {...params})
}

//物资
export function selectGoods(){
  return http.get('systemConfig/selectGoods')
}
export function updateGoods(params) {
  return http.post('systemConfig/updateGoods ', {...params})
}
export function insertGoods(params) {
  return http.post('systemConfig/insertGoods ', {...params})
}
export function deleteGoods(params) {
  return http.post('systemConfig/deleteGoods ', {...params})
}

//维修厂
export function selectRepairFactory(){
  return http.get('systemConfig/selectRepairFactory')
}
export function updateRepairFactory(params) {
  return http.post('systemConfig/updateRepairFactory ', {...params})
}
export function insertRepairFactory(params) {
  return http.post('systemConfig/insertRepairFactory ', {...params})
}
export function deleteRepairFactory(params) {
  return http.post('systemConfig/deleteRepairFactory ', {...params})
}

//供应商
export function selectSupplier(){
  return http.get('systemConfig/selectSupplier')
}
export function updateSupplier(params) {
  return http.post('systemConfig/updateSupplier ', {...params})
}
export function insertSupplier(params) {
  return http.post('systemConfig/insertSupplier ', {...params})
}
export function deleteSupplier(params) {
  return http.post('systemConfig/deleteSupplier ', {...params})
}

//预警项目
export function selectWarnProject(){
  return http.get('systemConfig/selectWarnProject')
}
export function updateWarnProject(params) {
  return http.post('systemConfig/updateWarnProject ', {...params})
}
export function insertWarnProject(params) {
  return http.post('systemConfig/insertWarnProject ', {...params})
}
export function deleteWarnProject(params) {
  return http.post('systemConfig/deleteWarnProject ', {...params})
}


//获取维修保养
export function selectRepairMaintainProjAndSon() {
  return http.post('systemConfig/selectRepairMaintainProjAndSon')
}
//增加新的
export function insertRepairMaintainProjAndSon(params) {
  return http.post('systemConfig/insertRepairMaintainProjAndSon ', {...params})
}
//修改
export function updateRepairMaintainProjAndSon(params) {
  return http.post('systemConfig/updateRepairMaintainProjAndSon ', {...params})
}
//删除父
export function deleteRepairMaintainProj(id) {
  return http.post('systemConfig/deleteRepairMaintainProj/'+id)
}
//删除子
export function deleteRepairMaintainProjSon(id) {
  return http.post('systemConfig/deleteRepairMaintainProjSon/'+id)
}

//预警详情
export function selectwarnDetailsList() {
    return http.post('warnDetails/list')
}
export function selectwarnDetailsLists(params) {
  return http.post('warnDetails/list', {...params})
}
export function selectlistWarnTimeAndPerson() {
    return http.post('warnDetails/listWarnTimeAndPerson')
}
export function updateWarn(id) {
  return http.post('warnDetails/updateWarn/'+id)
}
//预警详情excel下载
export function warnDetailsdownloadExcel() {
  http.download('/warnDetails/downloadExcel', '预警详情信息.xlsx')
}

//预警里程配置
export function vehicleMileageWarnConfigList() {
  return http.post('vehicleMileageWarnConfig/list')
}
export function vehicleMileageWarnConfigLists(params) {
  return http.post('vehicleMileageWarnConfig/list',{...params})
}
export function vehicleMileageWarnConfigupdate(params) {
  return http.post('vehicleMileageWarnConfig/update',{...params})
}
export function vehicleMileageWarnConfigadd(params) {
  return http.post('vehicleMileageWarnConfig/add',{...params})
}
export function vehicleMileageWarnConfigdelete(id) {
  return http.post('vehicleMileageWarnConfig/delete/'+id)
}

//车辆时间预警配置
export function vehicleTimeWarnConfigList() {
  return http.post('vehicleTimeWarnConfig/list')
}
export function vehicleTimeWarnConfigLists(params) {
  return http.post('vehicleTimeWarnConfig/list',{...params})
}
export function vehicleTimeWarnConfigupdate(params) {
  return http.post('vehicleTimeWarnConfig/update',{...params})
}
export function vehicleTimeWarnConfigadd(params) {
  return http.post('vehicleTimeWarnConfig/add',{...params})
}
export function vehicleTimeWarnConfigdelete(id) {
  return http.post('vehicleTimeWarnConfig/delete/'+id)
}

//人员预警
export function empWarnConfigList() {
  return http.post('empWarnConfig/list')
}
export function empWarnConfigupdate(params) {
  return http.post('empWarnConfig/update',{...params})
}
export function empWarnConfigadd(params) {
  return http.post('empWarnConfig/add',{...params})
}
export function empWarnConfigdelete(id) {
  return http.post('empWarnConfig/delete/'+id)
}
/**
 * 月行驶里程和费用添加
 */
 export function driveCostAdd(params) {
  return http.post('/monthDriveMileageCost/add', params)
}

/**
 * 月行驶里程和费用修改
 */
 export function driveCostUpdate(params) {
  return http.post('/monthDriveMileageCost/update', params)
}

/**
 * 月行驶里程和费用删除
 */
 export function driveCostDelete(id) {
  return http.post(`/monthDriveMileageCost/delete/${id}`)
}

/**
 * 月行驶里程和费用插入
 */
 export function driveCostInsert(params) {
  return http.post(`/monthDriveMileageCost/addDetail`, params)
}

/**
 * 月行驶里程和费用详情删除
 */
 export function driveCostDetailDelete(id) {
  return http.post(`/monthDriveMileageCost/deleteDetail/${id}`)
}

/**
 * 物资出库列表
 */
export function goodsOutList(params) {
  return http.post('/goodsOutStorehouse/list', params)
}

/**
 * 物资出库添加
 */
export function goodsOutAdd(params) {
  return http.post('/goodsOutStorehouse/add', params)
}

/**
 * 物资出库修改
 */
 export function goodsOutUpdate(params) {
  return http.post('/goodsOutStorehouse/update', params)
}

/**
 * 物资出库删除
 */
 export function goodsOutDelete(id) {
  return http.post(`/goodsOutStorehouse/delete/${id}`)
}

/**
 * 物资入库列表
 */
export function goodsInList(params) {
  return http.post('/goodsIntoStorehouse/list', params)
}

/**
 * 物资入库添加
 */
export function goodsInAdd(params) {
  return http.post('/goodsIntoStorehouse/add', params)
}

/**
 * 物资入库修改
 */
 export function goodsInUpdate(params) {
  return http.post('/goodsIntoStorehouse/update', params)
}

/**
 * 物资入库删除
 */
export function goodsInDelete(id) {
  return http.post(`/goodsIntoStorehouse/delete/${id}`)
}

/**
 * 物资盘点列表
 */
 export function goodsCheckList(params) {
  return http.post('/goodsCheck/list', params)
}

/**
 * 物资盘点添加
 */
export function goodsCheckAdd(params) {
  return http.post('/goodsCheck/add', params)
}

/**
 * 物资盘点修改
 */
 export function goodsCheckUpdate(params) {
  return http.post('/goodsCheck/update', params)
}

/**
 * 物资盘点删除
 */
export function goodsCheckDelete(id) {
  return http.post(`/goodsCheck/delete/${id}`)
}

/**
 * 首页预警信息
 */
export function warningList(params) {
  return http.post('/warnDetails/listWarning', params)
}

/**
 * 关于我们
 */
export function aboutUs(params) {
  return http.get('/aboutUs/companyInfo', params)
}

/**
 * 列表类接口(无需参数)
 */
/**
 * 仓库名称
 */
export function systemStoreList() {return http.post('/systemConfig/selectStorehouseName')}

/**
 * 物资名称
 */
export function systemGoodsList() {return http.post('/systemConfig/selectGoods')}

/**
 * 物资类别
 */
export function systemGoodsTypeList() {return http.post('/systemConfig/selectGoodsClass')}

/**
 * 供应商
 */
export function systemGoodsSupplierList() {return http.post('/systemConfig/selectSupplier')}

/**
 * 检测评定类别
 */
export function systemCheckTypeList() {return http.post('/systemConfig/selectCheckEvaluateClass')}

/**
 * 检测评定单位
 */
export function systemCheckOrgList() {return http.post('/systemConfig/selectCheckEvaluateOrg')}

/**
 * 车辆类型列表
 */
 export function vehicleBasicInfoCartype() {
  return http.post('/systemConfig/selectVehicleClass')
}

// 部门列表
export function listDept() {
  return http.get('/systemConfig/selectDept')
}

// 小组列表
export function listTeam() {
  return http.get('/systemConfig/selectTeam')
}

/**
 * 获取logo
 */
 export function systemLogoImg() {return http.post('/systemConfig/imageList/1')}

//上传图片systemConfig/uploadImage
export function systemConfiguploadImage(params) {
  return http.post('/systemConfig/uploadImage', params)
}
export function getuploadImageurl(paras) {
  return http.post('systemConfig/imageList/1')
}
